﻿@using System.Data
@using ZoomLa.Common
@using ZoomLa.Model
@using ZoomLa.BLL
@model ZoomLa.SQLDAL.SQL.PageSetting
@{
    Model.cols = 8;
}
@functions {
    B_Exam_Class classBll = new B_Exam_Class();
    public string GetTeachClass(int classid)
    {
        M_Exam_Class classMod = classBll.GetSelect(classid);
        if (classMod != null && classMod.C_id > 0)
        {
            return classMod.C_ClassName;
        }
        else
        {
            return "主科目";
        }
    }
    public string GetRemark(string remark)
    {
        if (remark.Length > 25)
        {
            return remark.Substring(0, 25) + "...";
        }
        else
        {
            return remark;
        }
    }
}
<table id="EGV" class="table table-striped table-bordered table-hover">
    <tr align="center" class="title">
        <td width="5%"></td>
        <td width="10%" class="title">教师名称</td>
        <td width="10%" class="title">职位</td>
        <td width="10%" class="title">授课科目</td>
        <td width="10%" class="title">授课名称</td>
        <td width="15%" class="title">创建时间</td>
        <td width="30%" class="title">老师信息</td>
        <td width="15%" class="title">操作</td>
    </tr>
    @if (Model.itemCount > 0)
    {
        foreach (DataRow dr in Model.dt.Rows)
        {
            <tr>
                <td height="22" align="center">
                    <input name="idchk" type="checkbox" value='@dr["ID"]' />
                </td>
                <td height="22" align="center">@dr["TName"]</td>
                <td height="22" align="center">@dr["Post"]</td>
                <td height="22" align="center">
                    @GetTeachClass(DataConverter.CLng(dr["TClsss"]))
                </td>
                <td height="22" align="center">@dr["Teach"]</td>
                <td height="22" align="center">@DataConverter.CDate(dr["CreatTime"]).ToString("yyyy-MM:dd HH:mm")</td>
                <td height="22" align="center">@MvcHtmlString.Create(GetRemark(dr["Remark"].ToString()))</td>
                <td height="22" align="center">
                    <a href="AddExTeacher?id=@dr["ID"]" class="option_style"><i class="fa fa-pencil" title="修改"></i></a>
                    <a href="javascript:;" onclick='mvcpage.del({url: "Teacher_Del", ids: @dr["ID"], confirm: "确定要删除此教师吗？"});' class="option_style"><i class="fa fa-trash-o" title="删除"></i>删除</a>
                </td>
            </tr>
        }
    }
    else
    {
        <tr><td colspan="8">当前没有数据</td></tr>
    }
    @Html.Partial("_page", Model)
</table>